package com.cj.bus.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cj.bus.common.entity.ValidationGroups;

import java.time.LocalDateTime;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 资源评论表
 * </p>
 *
 * @author yangh73
 * @since 2021-01-10
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BusResourceCommentEntity对象", description="资源评论表")
@TableName("bus_resource_comment")
public class BusResourceCommentEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "评论id")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Long commentId;

    @ApiModelProperty(value = "资源id")
    @NotNull(message = "资源ID不能为空", groups= {ValidationGroups.Add.class})
    private Long resourceId;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "用户名称")
    private String userName;

    @ApiModelProperty(value = "评论内容")
    @NotBlank(message = "评论内容不能为空", groups= {ValidationGroups.Add.class})
    private String content;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;


}
